#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Project: spd-sxmcc
"""
@author: lyndon
@time Created on 2019/2/18 14:55
@desc
"""

import time
import threading


def wahaha(n):
    time.sleep(0.5)
    print(n, threading.current_thread())


for i in range(10):
    threading.Thread(target=wahaha, args=(i,)).start()
print('threading.active_count:' + str(threading.active_count()))  # 11
print('MainThread:' + str(threading.current_thread()))

# 子线程
print(threading.enumerate())

# for subtrd in threading.enumerate():
#     print(subtrd.getName(), subtrd.ident)
